﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="product_brand_Show.aspx.cs" Inherits="Automobile.service.UI.product_brand_Show" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>资讯列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 资讯管理 <span class="c-gray en">&gt;</span> 资讯列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c"> <span class="select-box inline">
		 <marquee style="color:red; width="300px" height="28px" direction="left" scrollamount="8">
      <%=Session["IP"] %>正在查询损溢单,该项目由毛大大跟家大大完成！！欢迎你使用！
    </marquee>

		</span>
	</div>
	<%--<span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" data-title="添加资讯" _href="article-add.html" onclick="Hui_admin_tab(this)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加资讯</a></span> <span class="r">共有数据：<strong>54</strong> 条</span>--%> 
    <div class="cl pd-5 bg-1 bk-gray mt-20">
         <span class="l" style="margin-left:50px;font-family:华文行楷;font-size:18px">单据类型:<select id="Select1" onchange="por()">
        <option>商品报损</option>
        <option>商品报溢</option>
    </select></span>
         <span class="r" style="margin-left:50px;font-family:华文行楷;font-size:18px">
         <input id="Radio1" type="radio"  value="单据表" name="ck" checked="checked" onclick="dc()"/>单据表<input id="Radio2" type="radio" value="明细表" name="ck" onclick="mc()"/>明细表</span>
    </div>
	    <div class="mt-20" id="div">
		<table class="table table-border table-bordered table-bg table-hover table-sort" id="prof">
			<thead>
				<tr class="text-c">
                    <th id="lor">报损编号</th>
					<th id="lor1">报损日期</th>
                    <th>仓库名称</th>
                    <th>经办人</th>
                    <th>备注</th>
				</tr>
			</thead>
			<tbody>
		
				
			</tbody>
		</table>
	</div>
    	<div class="mt-20"  style="margin-top:50px" id="div1">
    <span>单据的详细信息:</span>
            	</div> 
    	<div class="mt-20" id="div2">
		<table class="table table-border table-bordered table-bg table-hover table-sort" id="table_pro">
			<thead>
				<tr class="text-c">
					<th>商品编号</th>
                    <th>商品名称</th>
                    <th>数量</th>
                    <th>单价</th>
                    <th>总金额</th>
                    <th>单位</th>
                    <th>规格</th>
                    <th>备注</th>
 				</tr>
			</thead>
			<tbody>
		
				
			</tbody>
		</table>
	</div>
    <div class="mt-20" id="div3">
        <table class="table table-border table-bordered table-bg table-hover table-sort" id="table_list">
			<thead>
				<tr class="text-c">
					<th id="lor3">报损日期</th>
                    <th id="lor2">报损单号</th>
                    <th>商品编号</th>
                    <th>商品名称</th>
                    <th>报损数量</th>
                    <th>仓库名称</th>
                    <th>经办人</th>
                    <th>备注</th>
 				</tr>
			</thead>
			<tbody>
		
				
			</tbody>
		</table>
    </div>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript">
</script>
</body>
</html>
<script>
    function por() {
        var ss = $("#Select1 option:selected").val();
        if (ss == "商品报损") {
            $("#lor").html("报损编号");
        }
        else {
            $("#lor").html("报溢编号");
        }
        if (ss == "商品报损") {
            $("#lor1").html("报损日期");
            $("#lor3").html("报损日期");
            $("#lor2").html("报损单号");
        }
        else {
            $("#lor1").html("报溢日期");
            $("#lor3").html("报溢日期");
            $("#lor2").html("报溢单号");
        }
        $("#prof tbody").empty();
        $("#table_pro tbody").empty();
        $("#table_list tbody").empty();
        $.ajax({
            type: "post",
            url: "Handler/HandlerDocument_show.ashx",
            data: {
                Document_Type_Name:ss,
            },
            success: function (data) {
                var data1 = eval(data);
                $(data1).each(function (index, item) {
                    var str = "" + item.Document_Date + "";
                    function data_string(str) {
                        var d = eval('new ' + str.substr(1, str.length - 2));
                        var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
                        for (var i = 0; i < ar_date.length; i++) ar_date[i] = dFormat(ar_date[i]);
                        return ar_date.join('-');

                        function dFormat(i) { return i < 10 ? "0" + i.toString() : i; }
                    }
                    var ss = "<tr class='text-c'><td>" + item.Document_num + "</td><td>" + data_string(str) + "</td><td>" + item.WareHose_Name + "</td><td>" + item.Employee_Name + "</td><td>" + item.Document_Remark + "</td></tr>";
                    $("#prof tbody").append(ss);

                })
            }
        })
        $.ajax({
            type: "post",
            url: "Handler/HandlerDocument_Pro.ashx",
            data: {
                Document_Type_Name: ss,
            },
            success: function (data1) {
                var data = eval(data1);
                $(data).each(function (index, item1) {
                    var ss1 = "<tr class='text-c'><td>" + item1.Product_Id + "</td><td>" + item1.Product_Name + "</td><td>" + item1.Document_Mate_Num + "</td><td>" + item1.Document_Mate_Price + "</td><td>" + item1.Document_Mate_SumPrice + "</td><td>" + item1.Product_Unit_Id + "</td><td>" + item1.Product_Modelspe + "</td><td>" + item1.Document_Remark + "</td></tr>";
                    $("#table_pro tbody").append(ss1);

                })
            }
        })
        $.ajax({
            type: "post",
            url: "Handler/HandlerDocument_Show_List.ashx",
            data: {
                Document_Type_Name: ss,
            },
            success: function (data2) {
                var datae = eval(data2);
                $(datae).each(function (index, item1) {
                    var str1 = "" + item1.Document_Date + "";
                    function data_string(str1) {
                        var d = eval('new ' + str1.substr(1, str1.length - 2));
                        var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
                        for (var i = 0; i < ar_date.length; i++) ar_date[i] = dFormat(ar_date[i]);
                        return ar_date.join('-');

                        function dFormat(i) { return i < 10 ? "0" + i.toString() : i; }
                    }
                    var ss2 = "<tr class='text-c'><td>" + data_string(str1) + "</td><td>" + item1.Document_num + "</td><td>" + item1.Product_Id + "</td><td>" + item1.Product_Name + "</td><td>" + item1.Document_Mate_Num + "</td><td>" + item1.WareHose_Name + "</td><td>" + item1.Employee_Name + "</td><td>" + item1.Document_Remark + "</td></tr>";
                    $("#table_list tbody").append(ss2);
                })
            }
        })
    }
    $(function () {
        if($("#Radio1").attr("checked")=="checked")
        {
            $("#div").show();
            $("#div1").show();
            $("#div2").show();
            $("#div3").hide();
        }
    })
    function dc() {
      
            $("#div").show();
            $("#div1").show();
            $("#div2").show();
            $("#div3").hide();
    }
    function mc()
    {
        $("#div").hide();
        $("#div1").hide();
        $("#div2").hide();
        $("#div3").show();
    }
       
   
</script>
